home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
prog
/
peekpoke.zip
/
PEEKPOKE.003
Wrap
Text File
|
1985-08-24
|
14KB
|
328 lines
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---- ----
---- █▀▀▀▄ █▀▀▀▀ █▀▀▀▀ █ █ ▄ █▀▀▀▄ ▄█▀█▄ █ █ █▀▀▀▀ ----
---- █▄▄▄▀ █▄▄▄ █▄▄▄ █▄▄▀ ▄▄█▄▄ █▄▄▄▀ █ █ █▄▄▀ █▄▄▄ ----
---- █ █ █ █ ▀▄ █ █ █ █ █ ▀▄ █ ----
---- █ █▄▄▄▄ █▄▄▄▄ █ █ █ ▀█▄█▀ █ █ █▄▄▄▄ ----
---- ----
---- ▄▀▀▀▄ █ █ ▄▀▀▀▄ █▀▀▀▄ ▀▀▀█▀▀▀ ----
---- █ █▄▄▄█ █▄▄▄█ █▄▄▄▀ █ ----
---- █ █ █ █ █ █ █ █ ----
---- ▀▄▄▄▀ █ █ █ █ █ █▌ █ ----
---- ----
---- ▄▄▄▄▄ ▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄ ▄▄▄ ----
---- FOR █ █ █ █ █ █ █ █ █ ▀ ----
---- █ █▀▀▀▄ █ █ ▀▀▀▀▀ █▀▀▀ █ ----
---- THE ▄▄█▄▄ █▄▄▄▀ █ █ █ ▀▄▄▄▀ ----
---- ----
---- ----
----------------------------------------------------------------------------
----------------------------------------------------------------------------
This Document has been created for the Universal use
of all IBM-PC and PC compatible systems, and encourages
all users to participate in it's spirit by appending this
document with any additional material that may be useful
to other users.
It is requested that donators submit peeks and pokes
to be used in IBM BASIC(A) Version 2.00. If the peeks
and pokes do not function in ALL current versions of DOS,
please state which versions it DOES work in. It is also
asked that donors keep the same format as has been initiated
with the original submissions.
Donators to Peeks and Pokes assume NO responsibility
for their submissions....Use on your own judgement.
-------------------------------------------------------------------
KEYBOARD BUFFER Jeff Askew 1/16/84
---------------
DEF SEG=0: POKE 1050 , PEEK(1052): DEF SEG
This clears the DOS system keyboard buffer.
Works very well in compiled Basic.
-------------------------------------------------------------------
MONITORS Jeff Askew 1/16/84
--------
ADDRESS = &HB000 '--- &HB800 to test for color monitor
DEF SEG = ADDRESS: POKE 1,16
IF PEEK(1) = 16 THEN MONOCHROME = TRUE '--- or COLOR=TRUE
This is one simple way to see which monitors are connected.
If ADDRESS = &HB800 (for color), then substitute COLOR=TRUE
for MONOCHRONE=TRUE.
-------------------------------------------------------------------
ACTIVE MONITOR Jeff Askew 1/16/84
--------------
DEF SEG=0: IF (PEEK(1040) AND 48) = 48 THEN MONO.ACTIVE = TRUE
ELSE COLOR.ACTIVE = TRUE
This determines which monitor is active at the time.
-------------------------------------------------------------------
MONITOR WIDTH Jeff Askew 1/16/84
-------------
SCREEN 0,0,0,0: WIDTH 40: CLS
OUT 948,2: OUT 949,62
This changes the screen dimensions to 40 column width,
but centers the screen in the middle of the monitor.
ALL of the commands above must be executed before the
OUT's even if that is the current video mode set, otherwise
strange things happen.
-------------------------------------------------------------------
MORE COLORS Jeff Askew 1/16/84
-----------
OUT &H3D8,9 '--- in 80x25 color mode
OUT &H3D8,8 '--- in 40x25 color mode
This will disable blinking mode, but enable extended
background colors in text mode. The full 16 colors
will then be available for the background, not just
the usual 8.
-------------------------------------------------------------------
MONITOR PORTS Jeff Askew 2/23/84
-------------
----- Monochrome ----
OUT 952,1 'Disable Monochrome display
OUT 952,15 'Disable Mono Bilnk
OUT 952,255 'Normal Mono Pattern
--- 80 x 25 Color --- --- 40 x 25 Color ---
OUT 984,1 'Disable Display OUT 984,0 'Disable Display
OUT 984,9 'Disable Blink OUT 984,8 'Disable Blink
OUT 984,41 'Normal Pattern OUT 984,40 'Normal Pattern
--- 80 x 25 B&W --- --- 40 x 25 B&W ---
OUT 984,5 'Disable Display OUT 984,4 'Disable Display
OUT 984,13 'Disable Blink OUT 984,12 'Disable Blink
OUT 984,45 'Normal Pattern OUT 984,44 'Normal Pattern
These OUT's are neat little tricks, and can be quite useful.
For example: Disable the color monitor's display while doing
the initial drawings for graphics GET statements. This way,
the shapes will not flash up on the screen. Not earthshaking
but it adds a touch of class to the program.
-------------------------------------------------------------------
SCREEN DIMENSIONS Jeff Askew 1/16/84
-----------------
POKE 91,xx '--- Top row
POKE 92,xx '--- Bottom row
POKE 41,xx '--- Right column
These locations store the boundries for Basic's scrolling.
By changing these values from the defaults, you may alter
the window that the Basic editor scrolls up. This is a
most interesting set with many potential uses.
-------------------------------------------------------------------
SYSTEM CONFIGURATION Jeff Askew 1/16/84
--------------------
[ DEF SEG=0 ]
LOCATION 1040: DDVV RRXI ( Bit-Mapped. )
DD = Number of Disk drives -1.
VV = Current video mode:
1 - 40x25 with color/graphics card.
2 - 80x25 with c/g card.
3 - 80x25 with Monochrome card.
RR = Ram installed on the motherboard.
0/16k, 1/32k, 2/48k, 3/64k
X = Unused.
I = 0 if no disk drives on system,
1 if disk drive(s) are present.
LOCATION 1041: PPXG CCCX
PP = Number of printer adapters.
X = Unused.
G = Number of game adapters.
CCC = Number of RS232-C adapters.
-------------------------------------------------------------------
KEYBOARD STATUS Jeff Askew 1/16/84
---------------
[ DEF SEG=0 ]
LOCATION 1047: ICNS AXLR ( Bit-Mapped. )
I = Insert state (1/0).
C = Caps-Lock state.
N = Num-Lock state.
S = Scroll-Lock state.
A = Alt-Shift being pressed.
X = Ctrl-Shift being pressed.
L = Left shift being pressed.
R = Right shift being pressed.
LOCATION 1048: ICNS XXXX
I = Insert being pressed.
C = Caps-Lock being pressed.
N = Num-Lock being pressed.
S = Scroll-Lock being pressed.
These are very uesful ways to fully control the keyboard
input. All bits are either on(1) or off(0).
-------------------------------------------------------------------
KEYBOARD Jeff Askew 2/23/84
--------
OUT 97,204 'disables
OUT 97,76 'enables
These port patterns can be used to easily disable the
keyboard interrupts. When the keyboard is disabled or
'Locked-up', any key struck is totally ignored. It will
NOT go into the buffer or be processed. Just be sure
that your test program enables it again before ending,
or you will have to do a hard-IPL!!!
-------------------------------------------------------------------
DISK Jeff Askew 2/23/84
----
[ DEF SEG = 64 ]
T=PEEK(69) 'Current Track Number
H=PEEK(70) 'Current Head Number
S=PEEK(71) 'Current Sector Number
B=(128*2^PEEK(72)) 'Number of Bytes per Sector
This set of addresses is very useful for determining
what version DOS is being used and the current location
of the Read/Write heads.
-------------------------------------------------------------------
PROTECTION Jeff Askew 2/23/84
----------
[ DEF SEG ]
POKE 1124,255 'Protects program in memory
POKE 1124,0 'Un-Protects program
This can enable you to protect or un-protect a BASIC
program just like saving it with the ',P' argument to
the SAVE command. An important point to be aware of is
that when you POKE 1124,255 to protect the program, this
also blocks out any subsequent POKE statements, and also
will not allow you to alter the program in any way!!
-------------------------------------------------------------------
MISC Jeff Askew 2/23/84
---- [ DEF SEG ]
LOCATION (hex) PURPOSE
---------- ----------------
2E & 2F Line number of the current line being executed.
258 & 259 Offset of start of program variables.
30 & 31 Offset of start of program text.
The most important of these three is the last one. Using
this location in DOS 2.00, one may successfully and con-
sistantly use the SHELL command (what shell command?!?!).
Use it as such, with the POKE statements IMMEDIATELY
following the SHELL command:
DEF SEG : A=PEEK(30) : B=PEEK(31)
SHELL CHKDSK '-- Invokes any DOS command
POKE 30,A : POKE 31,B
-------------------------------------------------------------------
COM: Jeff Askew 2/23/84
----
ADDR = PEEK(com.num*2-2) + 256*(PEEK(com.num*2-1))
STATUS = PEEK(ADDR+6)
The byte returned decodes as follows:
SRDC LTAB
S = Received line signal detect L = Delta receive line signal detect
R = Ring indicator T = Trailing edge ring indicator
D = Delta set ready A = Delta data set ready
C = Clear to send B = Delta clear to send
This byte allows easy access and control of communications
activity and is especially useful in custom communications
software. ( 'com.num' above is the number of the com port:
i.e. Com1: = 1 , Com2: = 2 , etc...)
-------------------------------------------------------------------
BASIC INTERPRETER Todd Hartle 2/4/84
-----------------
[ DEF SEG ]
PEEK(106) 'Number of characters in BASICS buffer
PEEK(839) + 256 * PEEK(840) 'Line number of last error
-------------------------------------------------------------------
SPEAKER Todd Hartle 2/4/84
-------
OUT 97,(INP(97) or 3) 'Turn speaker on
OUT 97,(INP(97) and 252) 'Turn speaker off
-------------------------------------------------------------------
SWITCH DISPLAYS Todd Hartle 2/4/84
---------------
[ DEF SEG=64 ]
CRT=(PEEK(16) and 48)/16
If CRT = 3 then switch to color else switch to monochrome.
POKE 16,(PEEK(16) or 48) 'Switch to mono
POKE 16,(PEEK(16) and 207) or 16 'Switch to color
After using one of the POKES also use these lines:
LOCATE ,,,7,7
LOCATE 1,10
SCREEN 0:WIDTH 40:WIDTH 80
INP(954) 'Check if mono is avaliable. Not avaliable if equals 255.
INP(986) 'Check if color is avaliable. Not avaliable if equals 255.
-------------------------------------------------------------------
MORE MISC. Todd Hartle 2/4/84
---- -----
Click cassete port:
OUT 97,68
OUT 97,77
Note: Some kind of delay will need to be used inbetween the statements
else sound will be very faint.(example: FOR I= 1 TO 2:NEXT I)
----------------------------------------------------------------------
MORE MISC. ???????????? ??/??/??
---- -----
Disable CNTRL/BRK Key
DEF SEG=0:POKE 108,83:POKE 109,255:POKE 110,0:POKE 111,240
----------------------------------------------------------------------
----------------------------------------------------------------------